8400 REM ==========================
8401 REM Date formatter
8402 REM INPUT - D$ A YYYYMMDD date
8403 REM OUTPUT - DFANCY$ A proper
8404 REM          Internet date
8405 REM ==========================
8410 DYEAR = VAL(LEFT$(D$, 4))
8420 DMONTH = VAL(MID$(D$, 5, 2))
8430 DDAY = VAL(RIGHT$(D$,2))
8440 DIM MDAYS[12]:MDAYS[1] = 5:MDAYS[2] = 1:MDAYS[3] = 1:MDAYS[4] = 4
8441 MDAYS[5] = 6:MDAYS[6] = 2:MDAYS[7] = 4:MDAYS[8] = 0:MDAYS[9] = 3
8442 MDAYS[10] = 5:MDAYS[11] = 1:MDAYS[12] = 3
8443 DAYNAME$ = "SunMonTueWedThuFriSatSun"
8444 MONTHNAME$ = "JanFebMarAprMayJunJulAugSepOctNovDec"
8450 MCODE = MDAYS[DMONTH]
8460 DOW = ((INT(DYEAR*1.25) + MCODE + DDAY) MOD 7)
8470 IF DYEAR MOD 4 = 0 AND DMONTH < 3 THEN DOW = (DOW + 6) MOD 7
8480 DFANCY$ = MID$(DAYNAME$, 3*DOW+1, 3) + ", " + RIGHT$(D$,2) + " "
8490 DFANCY$ = DFANCY$ + MID$(MONTHNAME$, (DMONTH-1)*3+1, 3) + " " + LEFT$(D$, 4) + " 12:00:00 +0000"
8498 ERASE MDAYS
8499 RETURN
